/****
 *  Project: vzTabPanel
 *  Version: 1.0

 *  Vizyon Yazılım Ar-Ge Ekibi - http://vizyonyazilim.com/
Kullanımı: ( http://www.kamilors.com/?p=73 )
	$(document).ready(function() {
		$('#tabPanel1').vzTabPanel(2);
	});
	<!-- TabPanel --> 
        <div id="tabPanel1"> 
            
            <!-- TabHeader --> 
            <div> 
                <div>Tab 1</div> 
                <div>Tab 2</div> 
                <div>Tab 3</div> 
                <div>Tab 4</div> 
                <div>Tab 5</div> 
                <div style="clear:both"></div> 
            </div> 
            <!-- /TabHeader --> 
            
            <!-- Contents --> 
            <div> 
                <div>Icerik 1</div> 
                <div>Icerik 2</div> 
                <div>Icerik 3</div> 
                <div>Icerik 4</div> 
                <div>Icerik 5</div> 
            </div> 
            <!-- /Contents --> 
            
        </div> 
        <!-- /TabPanel --> 
 
 */


jQuery.fn.vzTabPanel = function (selected) {

   jQuery(this).addClass("vz-tabPanel");

   var tabHeader = jQuery(this).children().get(0);

   jQuery(tabHeader).addClass("vz-tabHeader");
   jQuery(tabHeader).children().addClass("vz-tabHeader-item");

   var hdSize = jQuery(tabHeader).children().length;
   var clearDiv = jQuery(tabHeader).children().get(hdSize-1);
   jQuery(clearDiv).removeClass("vz-tabHeader-item");

   var selectedItem = jQuery(tabHeader).children().get(selected);
   jQuery(selectedItem).addClass("vz-tabHeader-item-active");

   var tabContend = jQuery(this).children().get(1);

   jQuery(tabContend).children().hide();
   jQuery(tabContend).children().addClass("vz-tabContent");

   var selectedTab = jQuery(tabContend).children().get(selected);
   jQuery(selectedTab).show();


   jQuery(tabHeader).children().click(function() {
        jQuery(tabHeader).children().removeClass("vz-tabHeader-item-active");
        $(this).addClass("vz-tabHeader-item-active");

        var indx = jQuery(tabHeader).children().index($(this));

        jQuery(tabContend).children().hide();

        var selectedTab = jQuery(tabContend).children().get(indx);
        jQuery(selectedTab).show();
   });

}